using System;
using UnityEngine;

public static class MultiColorExt
{
	public static void SetColor(MeshFilter filter, int index)
	{
		Vector2[] array = new Vector2[filter.mesh.vertexCount];
		array[0] = new Vector2((float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] % GameColor.colorRow) / (float)GameColor.colorRow, (float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] / GameColor.colorRow) / (float)GameColor.colorColumn);
		array[1] = new Vector2(((float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] % GameColor.colorRow) + 1f) / (float)GameColor.colorRow, (float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] / GameColor.colorRow) / (float)GameColor.colorColumn);
		array[2] = new Vector2((float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] % GameColor.colorRow) / (float)GameColor.colorRow, ((float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] / GameColor.colorRow) + 1f) / (float)GameColor.colorColumn);
		array[3] = new Vector2(((float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] % GameColor.colorRow) + 1f) / (float)GameColor.colorRow, ((float)(SingletonMonoBehaviour<ColorOrder>.Instance.color[index] / GameColor.colorRow) + 1f) / (float)GameColor.colorColumn);
		filter.mesh.uv2 = array;
	}
}
